package com.sendpo.zjx.sendpo.broadcastreceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.sendpo.zjx.sendpo.activity.LoginActivity;


/**
 * Created by Administrator on 2017/8/30.
 */

public class LoginWxBroadcastReceiver extends BroadcastReceiver {
     public LoginActivity loginActivity;
    public static final String ACTION_NAME="com.sendpo.zjx.sendpo.loginwsbroadcastreceiver";
      public  static final int LOGINWX=1011;
    public LoginWxBroadcastReceiver(LoginActivity loginActivity){
        this.loginActivity=loginActivity;
    }
    @Override
    public void onReceive(Context context, Intent intent) {
             int  flag=intent.getIntExtra("flag",0);
               switch (flag){
                   case LOGINWX:
                       String openid=intent.getStringExtra("openid");
                       String nickname=intent.getStringExtra("nickname");
                       loginActivity.createwxlogin(openid,nickname);

                       break;
               }
    }
}
